import {cropAll} from "@/api/crop";

const getDefaultState = () => {
    return {};
};

const state = getDefaultState();

const mutations = {};

const actions = {
    //查询所有种类
    async cropAll({state}) {
        return new Promise((resolve, reject) => {
            cropAll().then(response => {
                if (response.success) {
                    resolve(response.data);
                } else {
                    reject(response);
                }
            });
        });
    }
};

export default {
    namespaced: true,
    state,
    mutations,
    actions
};
